import React, {Component} from 'react';
import {Relax} from 'iflux2';
import {
  Table,
  Checkbox,
  Input
} from 'antd';
import {noop} from 'util/noop';

@Relax
export default class OrderOption extends Component{
  static defaultProps = {
    orderOptionsRequest: {},
    onSaveOptionsSetup: noop
  }
  render() {
    let {orderOptionsRequest, onSaveOptionsSetup} = this.props;
    let {display, required} = orderOptionsRequest.toJS();
    const columns = [{
      title:'填写项名称',
      dataIndex: 'name',
      width: 400,
      render:(value)=>(
        <div>
        公民身份证号：<Input disabled style={{width:'200px'}} />
        </div>)
      }, {
        title:'填写项类型',
        dataIndex: 'type',
      }, {
        title: '必填',
        dataIndex: 'required',
        render:(v) => (<Checkbox checked={v == 1} onChange={()=>onSaveOptionsSetup({required: v ? 0 : 1})}></Checkbox>)
      }, {
        title: '显示',
        dataIndex: 'display',
        render:(v) => (<Checkbox  checked={v == 1} onChange={()=>onSaveOptionsSetup({required: v ? 0 : 1})}></Checkbox>)
      }];
    let data = [{
      name: '',
      type: '系统默认',
      required,
      display
    }]
    return (
      <Table columns={columns} dataSource={data} pagination={false}></Table>
    )
  }
}